Scenario #9313: Newly Created Account for Existing Natural Person Should Be Able to View Existing Memberships

Properties

Required

Given

name value
subjectName xyz-peter.smith

Expected

name value
expectedMembershipsJson [
  {
    “partner”: {
      “partnerNumber”: “P-10002”,
      “partnerRel”: {
        “type”: “PARTNER”,
        “anchor”: { “tradeName”: “Hostsharing eG” },
        “holder”: { “tradeName”: “Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.” },
        “contact”: { “emailAddresses”: { “main”: “contact-admin@secondcontact.example.com” } }
      },
      “details”: {
        “registrationOffice”: “Hamburg”,
        “registrationNumber”: “RegNo123456789”
      }
    },
    “memberNumber”: “M-1000202”,
    “memberNumberSuffix”: “02”,
    “validFrom”: “2022-10-01”,
    “validTo”: “2025-12-31”,
    “status”: “CANCELLED”,
    “membershipFeeBillable”: true
  }
]

personUuid

HTTP GET "/api/hs/accounts/accounts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "242a0002-0000-0000-0000-000000000002", // Account: xyz-peter.smith
  "person" : {
    "uuid" : "32588021-af6f-47e4-978e-d8b50927e820", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "subject" : {
    "uuid" : "242a0002-0000-0000-0000-000000000002", // Account: xyz-peter.smith
    "name" : "xyz-peter.smith",
    "organization" : "xyz",
    "type" : "USER"
  },
  "globalUid" : 21011,
  "globalGid" : 21011
} ]

Fetch the account for the current subject to resolve the related person.

Resolve partner trade name

HTTP GET "/api/hs/office/relations?relationType=REPRESENTATIVE&personUuid=32588021-af6f-47e4-978e-d8b50927e820" // personUuid \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "2ffd3ab5-1a75-4dea-b5a6-6ec3dca30056",
  "anchor" : {
    "uuid" : "eabf7140-e674-4dd2-be51-e97fdb317d59",
    "personType" : "LEGAL_PERSON",
    "tradeName" : "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "holder" : {
    "uuid" : "32588021-af6f-47e4-978e-d8b50927e820", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "type" : "REPRESENTATIVE",
  "mark" : null,
  "contact" : {
    "uuid" : "784a23db-869f-44e5-ab5c-960fa62a28fa",
    "caption" : "second contact",
    "postalAddress" : {
      "country" : "Germany"
    },
    "emailAddresses" : {
      "main" : "contact-admin@secondcontact.example.com"
    },
    "phoneNumbers" : {
      "phone_office" : "+49 123 1234567"
    }
  }
} ]

Resolve partner UUID

HTTP GET "/api/hs/office/partners?name=Peter+Smith+-+The+Second+Hand+and+Thrift+Stores-n-Shipping+e.K." \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "d6856fa4-1cad-4648-a196-a381810b8e02",
  "partnerNumber" : "P-10002",
  "partnerRel" : {
    "uuid" : "7b6e2a87-209b-477f-96a4-1ea5d0b1fd9b",
    "anchor" : {
      "uuid" : "882bda1d-4e5e-42f8-afdd-b9741d1c1f4e",
      "personType" : "LEGAL_PERSON",
      "tradeName" : "Hostsharing eG",
      "salutation" : null,
      "title" : null,
      "givenName" : null,
      "familyName" : null
    },
    "holder" : {
      "uuid" : "eabf7140-e674-4dd2-be51-e97fdb317d59",
      "personType" : "LEGAL_PERSON",
      "tradeName" : "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
      "salutation" : null,
      "title" : null,
      "givenName" : "Peter",
      "familyName" : "Smith"
    },
    "type" : "PARTNER",
    "mark" : null,
    "contact" : {
      "uuid" : "784a23db-869f-44e5-ab5c-960fa62a28fa",
      "caption" : "second contact",
      "postalAddress" : {
        "country" : "Germany"
      },
      "emailAddresses" : {
        "main" : "contact-admin@secondcontact.example.com"
      },
      "phoneNumbers" : {
        "phone_office" : "+49 123 1234567"
      }
    }
  },
  "details" : {
    "uuid" : "04ea7d51-ad55-4766-9a3a-4465021c45c9",
    "registrationOffice" : "Hamburg",
    "registrationNumber" : "RegNo123456789",
    "birthName" : null,
    "birthPlace" : null,
    "birthday" : null,
    "dateOfDeath" : null
  }
} ]

View their memberships

HTTP GET "/api/hs/office/memberships?partnerUuid=d6856fa4-1cad-4648-a196-a381810b8e02" // partnerUuid \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "b2947aa1-cd46-419d-8278-b5278856dc30",
  "partner" : {
    "uuid" : "d6856fa4-1cad-4648-a196-a381810b8e02", // partnerUuid
    "partnerNumber" : "P-10002",
    "partnerRel" : {
      "uuid" : "7b6e2a87-209b-477f-96a4-1ea5d0b1fd9b",
      "anchor" : {
        "uuid" : "882bda1d-4e5e-42f8-afdd-b9741d1c1f4e",
        "personType" : "LEGAL_PERSON",
        "tradeName" : "Hostsharing eG",
        "salutation" : null,
        "title" : null,
        "givenName" : null,
        "familyName" : null
      },
      "holder" : {
        "uuid" : "eabf7140-e674-4dd2-be51-e97fdb317d59",
        "personType" : "LEGAL_PERSON",
        "tradeName" : "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
        "salutation" : null,
        "title" : null,
        "givenName" : "Peter",
        "familyName" : "Smith"
      },
      "type" : "PARTNER",
      "mark" : null,
      "contact" : {
        "uuid" : "784a23db-869f-44e5-ab5c-960fa62a28fa",
        "caption" : "second contact",
        "postalAddress" : {
          "country" : "Germany"
        },
        "emailAddresses" : {
          "main" : "contact-admin@secondcontact.example.com"
        },
        "phoneNumbers" : {
          "phone_office" : "+49 123 1234567"
        }
      }
    },
    "details" : {
      "uuid" : "04ea7d51-ad55-4766-9a3a-4465021c45c9",
      "registrationOffice" : "Hamburg",
      "registrationNumber" : "RegNo123456789",
      "birthName" : null,
      "birthPlace" : null,
      "birthday" : null,
      "dateOfDeath" : null
    }
  },
  "mainDebitor" : null,
  "memberNumber" : "M-1000202",
  "memberNumberSuffix" : "02",
  "validFrom" : "2022-10-01",
  "validTo" : "2025-12-31",
  "status" : "CANCELLED",
  "membershipFeeBillable" : true
} ]

generated on 2026-08-10 04:34:15 for branch HEAD